package com.haiya.adapter.motorcase;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Client {
    public static void main(String[] args) throws IOException {
        BufferedReader strin = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("input motor type: ");
        String type = strin.readLine();

        if (type.equals("electric")) {
            ElectricMotor electricMotor = new ElectricMotor();
            ElectricAdapter adapter = new ElectricAdapter(electricMotor);
            adapter.drive();
        } else if (type.equals("optical")) {
            OpticalMotor opticalMotor = new OpticalMotor();
            OpticalAdapter adapter = new OpticalAdapter(opticalMotor);
            adapter.drive();
        }
    }
}
